﻿@model PhotoBlogApp.Core.Blog
<div class="block">
    @using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()

        <div class="form-horizontal">
            @Html.ValidationSummary(true, "", new { @class = "text-danger" })
            <div class="form-group">
                @Html.LabelFor(model => model.HeaderName, "Заголовок")
                <div>
                    @Html.EditorFor(model => model.HeaderName, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.HeaderName, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.ContentText, "Контент")
                <div>
                    @Html.TextAreaFor(model => model.ContentText, new { htmlAttributes = new { @class = "form-control ckeditor" } })
                    @Html.ValidationMessageFor(model => model.ContentText, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.Description, "Краткое описание")
                <div>
                    @Html.TextAreaFor(model => model.Description, new { @class = "form-control", rows = 5 })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.ImageUrl, "Картинка")
                <div>
                    @Html.EditorFor(model => model.ImageUrl, new { htmlAttributes = new { @class = "form-control" } })
                </div>
            </div>

            <div class="form-group">
                <div class="checkbox">
                    <label for="Hide">
                        <input class="check-box" style="position: static;margin-left: 0;" data-val="true" data-val-required="Требуется поле Hide." id="Hide" name="Hide" type="checkbox" value="true">
                        Скрытый
                    </label>
                    @Html.ValidationMessageFor(model => model.Hide, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                <div>
                    <input type="submit" value="Создать" class="btn btn-default" />
                </div>
            </div>
        </div>
    }
    <div>
        @Html.ActionLink("Назад", "Index")
    </div>
</div>

@section scripts{
    <script src="@Url.Content("~/Scripts/ckeditor/ckeditor.js")"></script>
    <script>
        $(function () {
            CKEDITOR.replace('ContentText');
        })
    </script>
}
